home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Multiprocessing 2.1v2 SDK / Sample Code / CPU meter ƒ / .h / Offscreen.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-14  |  4.1 KB  |  123 lines  |  [TEXT/CWIE]

  1. /***************************************************************************\
  2. |***************************************************************************|
  3. |                                                                            |
  4. |    File Name:    Offscreen.h                                                    |
  5. |                                                                            |
  6. |    Contains:    Implementation of _Offscreen GWorld buffers                    |
  7. |                                                                            |
  8. |    Written by:    GeoWar                                                        |
  9. |                                                                            |
  10. |    Copyright:    © 1995 by Apple Computer,Inc.,all rights reserved.            |
  11. |                                                                            |
  12. | **************************************************************************|
  13. |            C h a n g e        H i s t o r y (most recent first):                |
  14. | **************************************************************************|
  15. |        Vers      Date        Author        Description                            |
  16. |        ----    --------    ------    ----------------------------------------|
  17. |        2.12    12/15/99    GAW        Added Get/Set default NewGWorld flags    |
  18. |        2.10     6/16/99    GAW        SetPort_offscreen now returns pixmap    |
  19. |        2.8         12/16/98    GAW        Added Get/Set Pixel Depth                |
  20. |        2.7         12/16/98    GAW        Added Get/Set Default CopyBit mask        |
  21. |        2.6         12/3/98    GAW        moved saved port/device info to struct    |
  22. |        2.2         9/19/97    GAW        Added Get/Set Default Pixel Depth        |
  23. |        2.1         5/24/95    GAW        First public version                    |
  24. |        0.0         5/18/95    GAW        Initial version                            |
  25. |***************************************************************************|
  26. \***************************************************************************/
  27.  
  28. #ifndef __OFFSCREEN__
  29. #define __OFFSCREEN__
  30.  
  31. /**\
  32. |**|    includes
  33. \**/
  34.  
  35. #include <QDOffscreen.h>
  36.  
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT
  46. #pragma import on
  47. #endif
  48.  
  49. #if PRAGMA_STRUCT_ALIGN
  50.     #pragma options align=mac68k
  51. #elif PRAGMA_STRUCT_PACKPUSH
  52.     #pragma pack(push, 2)
  53. #elif PRAGMA_STRUCT_PACK
  54.     #pragma pack(2)
  55. #endif
  56.  
  57. /**\
  58. |**|    typedefs
  59. \**/
  60.  
  61. typedef struct Window_Offscreen {
  62.     CGrafPtr        windowPort;
  63.     GDHandle        windowDevice;
  64.     GWorldPtr        offscreenWorld;
  65.     GDHandle        offscreenDevice;
  66.     UInt32            pixelslockedCount;
  67.     CGrafPtr        savedCGrafPtr;
  68.     GDHandle        savedGDHandle;
  69.     SInt16            pixelDepth;
  70.     RgnHandle        maskRgnHdl;
  71. } Window_Offscreen,*Window_OffscreenPtr;
  72.  
  73. /**\
  74. |**|    Global function prototypes
  75. \**/
  76.  
  77. extern Window_OffscreenPtr Open_Offscreen(WindowPtr pWindowPtr);
  78. extern Window_OffscreenPtr Open_OffscreenBuffer(WindowPtr pWindowPtr,const Rect* pRect);
  79. extern void Copy_Offscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  80. extern void Copy_OffscreenBuffer(Window_OffscreenPtr pWindow_OffscreenPtr,const Rect* sRect,const Rect* dRect);
  81. extern void Copy_Onscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  82. extern void Copy_OnscreenBuffer(Window_OffscreenPtr pWindow_OffscreenPtr,const Rect* sRect,const Rect* dRect);
  83. extern void Close_Offscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  84. extern void SetPort_Onscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  85. extern PixMapHandle SetPort_Offscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  86. extern void Save_Port(Window_OffscreenPtr pWindow_OffscreenPtr);
  87. extern void Restore_Port(Window_OffscreenPtr pWindow_OffscreenPtr);
  88. extern PixMapHandle Lock_Offscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  89. extern void Unlock_Offscreen(Window_OffscreenPtr pWindow_OffscreenPtr);
  90. extern void Set_OnscreenWindow(Window_OffscreenPtr pWindow_OffscreenPtr,WindowPtr pWindowPtr);
  91.  
  92. extern SInt16 Get_DefaultPixelDepth(void);
  93. extern SInt16 Set_DefaultPixelDepth(const SInt16 pDefaultPixelDepth);
  94.  
  95. extern SInt16 Get_PixelDepth(Window_OffscreenPtr pWindow_OffscreenPtr);
  96. extern SInt16 Set_PixelDepth(Window_OffscreenPtr pWindow_OffscreenPtr,const SInt16 pDefaultPixelDepth);
  97.  
  98. extern RgnHandle Get_MaskRegion(Window_OffscreenPtr pWindow_OffscreenPtr);
  99. extern RgnHandle Set_MaskRegion(Window_OffscreenPtr pWindow_OffscreenPtr,RgnHandle pNewMaskRegion);
  100.  
  101. extern GWorldFlags Get_DefaultGWorldFlags(void);
  102. extern GWorldFlags Set_DefaultGWorldFlags(const GWorldFlags pFlags);
  103.  
  104. #if PRAGMA_STRUCT_ALIGN
  105.     #pragma options align=reset
  106. #elif PRAGMA_STRUCT_PACKPUSH
  107.     #pragma pack(pop)
  108. #elif PRAGMA_STRUCT_PACK
  109.     #pragma pack()
  110. #endif
  111.  
  112. #ifdef PRAGMA_IMPORT_OFF
  113. #pragma import off
  114. #elif PRAGMA_IMPORT
  115. #pragma import reset
  116. #endif
  117.  
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121.  
  122. #endif __OFFSCREEN__
  123.